$(document).ready(function(){
                    
            function appendOneInfoDiv()
            {
                var divs = $('.info_divs').find('.info_div');
                var num = divs.length + 1; 
                var oneDiv = '';
                $.ajax({
                  url: "Modules/contacts/classes/ajax_actions.php?func=getGatheredInfoBox&num="+num,
                  context: document.body,
                  async:false,
                  success: function(response){
                     $('.info_divs').append(response);
                  }
                });
            }

            $('.add_gathered_info').click(function(){
                appendOneInfoDiv();
                return false;
            });



            $('.info_type').live('change',function(){
                if ($(this).val() == '1')
                {
                    $('.info_divs').html('');
                    appendOneInfoDiv();
                    $('#info_details_1').hide();
                    $('#info_type_1').val('1');
                    $('.add_gathered_info').hide();
                }
                else
                {
                    $('#info_details_1').show();
                    $('.add_gathered_info').show();
                }
            });
    
		initilaizeIntervalFunctions();
	}
)
